<?php 
     require_once('nav.php');
          $conn=connect();
          $sql = 'select * from flower ';
          $result = mysql_query($sql) or die('filed'.mysql_error());
          $orders = fetch_array($result);


?>
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
         <div class="table-responsive">
          <h1 class="page-header">鲜花列表</h1>

             <a class="btn btn-primary btn-xs" href="floweradd.php" role="button">订单添加</a>
            <table class="table table-striped table-hover">
              <thead>
                <tr>
                  <th>鲜花标题</th>
                  <th>产地</th>
                  <th>简介</th>
                  <th>添加鲜花时间</th>
                  <th>操作</th>
                </tr>
              </thead>
              <tbody>
                <?php //var_dump($orders);
                    foreach ($orders as $one) {
                              echo '<tr>';
                              echo "<td><a href='detail.php?id=".$one['zb_id']."'>".$one['zb_title']."</a> ";
                              //echo '<td>'.$one['zb_title'].'</td>';
                              echo '<td>'.$one['zb_place'].'</td>';
                              echo '<td>'.$one['zb_adddate'].'</td>';
                              echo '<td>'.$one['zb_hint'].'</td>';
                              echo "<td><a class='btn btn-default' href='editorder.php?id=".$one['zb_id']."' role='button'>修改</a>";
                              echo '<a class="btn btn-default" href="delflower.php?id='.$one['zb_id'].'" onClick="return confirm(\'确定要删除吗？\');" role="button">删除</a></td>';
                              echo "</tr>";
                    }
                    $totalrows = count($orders);
                    echo "<table align='center'><tr><td>共有{$totalrows}个订单</td></tr></table>";   
               ?>
              </tbody>
            </table>
            </div>
        </div>
<?php require_once("footer.php") ?>
      